#ifndef _RADIAN_WORLD_LAYER_MANAGER_H_
#define _RADIAN_WORLD_LAYER_MANAGER_H_

#include "RadianCommon.h"

/* RadianWorldLayerManager is claimed to manager all the layers in a scene.
*/
class RadianWorldLayerManager 
{
public:
	RadianWorldLayerManager();
	~RadianWorldLayerManager();
	

public:
	typedef std::map<Ogre::String,RadianLayer*> WorldLayerMap;
	typedef WorldLayerMap::iterator WorldLayerIterator;

public:

	/* Add a layer.If layer index is -1,than it would be added to the top most level.
	*/
	bool AddLayer(const Ogre::String& layerName,int layerIndex = -1);
	
	/* Remove a layer by name.
	*/
	bool RemoveLayer(const Ogre::String& layerName);

	/* Remove a layer by index.
	*/
	bool RemoveLayer(int index);

	/* Get a layer
	*/
	RadianLayer* GetLayer(int index);

	/* Check if a layer with name exist.
	*/
	bool LayerExist(const Ogre::String& layerName);

	/* Bring a layer to a higher level.
	*/
	void BringToFront();

	/* Bring a layer to a lower level.
	*/
	void BringToBack();

	/* Get all layer data.
	*/
	WorldLayerMap& GetAllLayers() { return mWorldLayerMap; }

protected:
	WorldLayerMap mWorldLayerMap;			// resotre all the layers.
};
#endif